/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package avl.sv.shared.sources;

import avl.sv.shared.Solution;
import avl.sv.shared.XML.SolutionXML_Writer;
import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author benbryan
 */
public abstract class SolutionSource extends DefaultMutableTreeNode{
    private final int id;
    private final String name;
    
    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
    
    public SolutionSource(String name, int id) {
        this.name = name;
        this.id = id;
    }

    abstract public String setSolution(String xml);

    public String setSolution(Solution solution){
        String xml = SolutionXML_Writer.getXMLString(solution);
        return setSolution(xml);
    }
    
    abstract public Solution getSolution();
                      
    abstract public String delete();
    
    @Override
    public String toString(){
        return name;
    }
    
}
